package com.eastfair.projectcore.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author zjn
 * @since 2021-12-06
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("c_area")
@ApiModel(value = "Area", description = "")
@AllArgsConstructor
public class Area extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 名称
     */
    @ApiModelProperty(value = "名称")
    @Size(max = 38, message = "名称长度不能超过38")
    @TableField(value = "name", condition = LIKE)
    @Excel(name = "名称")
    private String name;

    /**
     * 父级id
     */
    @ApiModelProperty(value = "父级id")
    @TableField(value = "parent_id")
    @Excel(name = "父级id")
    private Long parentId;

    /**
     * 编码
     */
    @ApiModelProperty(value = "编码")
    @Size(max = 21, message = "编码长度不能超过21")
    @TableField(value = "code", condition = LIKE)
    @Excel(name = "编码")
    private String code;

    /**
     * 1区县，2市，3省，4国家，5洲，6国家级区域，7省份级区域
     */
    @ApiModelProperty(value = "1区县，2市，3省，4国家，5洲，6国家级区域，7省份级区域")
    @Size(max = 32, message = "1区县，2市，3省，4国家，5洲，6国家级区域，7省份级区域长度不能超过32")
    @TableField(value = "level", condition = LIKE)
    @Excel(name = "1区县，2市，3省，4国家，5洲，6国家级区域，7省份级区域")
    private String level;

    /**
     * 邮编
     */
    @ApiModelProperty(value = "邮编")
    @Size(max = 10, message = "邮编长度不能超过10")
    @TableField(value = "post_code", condition = LIKE)
    @Excel(name = "邮编")
    private String postCode;

    /**
     * 手机区号
     */
    @ApiModelProperty(value = "手机区号")
    @Size(max = 10, message = "手机区号长度不能超过10")
    @TableField(value = "phone_code", condition = LIKE)
    @Excel(name = "手机区号")
    private String phoneCode;

    /**
     * 英文名称
     */
    @ApiModelProperty(value = "英文名称")
    @Size(max = 70, message = "英文名称长度不能超过70")
    @TableField(value = "en_name", condition = LIKE)
    @Excel(name = "英文名称")
    private String enName;


    @Builder
    public Area(Long id, LocalDateTime createTime, Long createdBy, LocalDateTime updateTime, Long updatedBy, 
                    String name, Long parentId, String code, String level, String postCode, 
                    String phoneCode, String enName) {
        this.id = id;
        this.createTime = createTime;
        this.createdBy = createdBy;
        this.updateTime = updateTime;
        this.updatedBy = updatedBy;
        this.name = name;
        this.parentId = parentId;
        this.code = code;
        this.level = level;
        this.postCode = postCode;
        this.phoneCode = phoneCode;
        this.enName = enName;
    }

}
